/*
package com.diana.config;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import redis.clients.jedis.JedisPool;

*/
/**
 * jedispool
 *//*

@Configuration
public class JedisPoolConfig {

    private static final Logger LOGGER = LoggerFactory.getLogger(JedisPoolConfig.class);
    @Value("${spring.redis.host}")
    private String host;
    @Value("${spring.redis.password}")
    private String password;
    @Value("${spring.redis.port}")
    private int port;
    @Value("${spring.redis.timeout}")
    private int timeout;
    @Value("${spring.redis.jedis.pool.max-active}")
    private int maxActive;
    @Value("${spring.redis.jedis.pool.max-idle}")
    private int maxIdle;
    @Value("${spring.redis.jedis.pool.max-wait}")
    private int maxWaitMillis;

    @Bean
    public JedisPool jedisPool(){
        try {
            redis.clients.jedis.JedisPoolConfig config = new redis.clients.jedis.JedisPoolConfig();
            config.setMaxIdle(maxIdle);
            config.setMaxTotal(maxActive);
            config.setMaxWaitMillis(maxWaitMillis);
            JedisPool jedisPool = new JedisPool(config, host, port, timeout, password);
            LOGGER.info("初始化Redis连接池JedisPool成功!地址:" + host + ":" + port);
            return jedisPool;
        } catch (Exception e) {
            LOGGER.error("初始化Redis连接池JedisPool异常:{}" + e);
        }
        return null;
    }
}
*/
